
 
 F u n c t i o n :   G e t ( o b j e c t K e y V a l u e M a p O r A r r a y O f M a p s ) 
 
 
 
 D e s c r i p t i o n :   E x i c u t e s   o n e   o r   m o r e   c o n s e c u t i v e   F e t c h   A P I   q u e r i e s . 
 
 
 
 R e t u r n s :   N u l l . 
 
 
 
 N o t e :   W h e n   c h a i n e d   t o g e t h e r   w i t h i n   t h e   s a m e   a r r a y ,   e a c h   f e t c h   o b j e c t   w i l l   o n l y   e x i c u t e   a f t e r   t h e   s u c c e s s f u l   c o m p l e t i o n   o f   t h e   o n e   b e f o r e   i t .   H o w e v e r ,   w h e n   m u l t i p l e   G e t ( )   f u n c t i o n s   a r e   e x i c u t e d   i n   s u c c e s s i o n   w i t h   s e p a r a t e   o b j e c t s ,   t h e n   p r o c e s s i n g   i s   h a n d l e d   a s y n c h r o n o u s l y   t o   m a x i m i z e   p e r f o r m a n c e . 
 
 
 
 C o n f i g u r a t i o n   P r o p e r t i e s 
 
 
 
 { 
 
 
 
     u r l :   " r e s o u r c e P a t h " , 
 
 
 
     d a t a :   { 
 
         / /   O p t i o n s :   " h t m l " ,   " t e x t " ,   " x m l " ,   " j s o n " 
 
         r e t u r n T y p e :   " h t m l " , 
 
         / /   S e t s   a   C S S   q u e r y   s e l e c t o r   t o   r e t u r n   t h e   f i r s t   m a t c h i n g   n o d e   w i t h i n   t h e   n e w l y   l o a d e d   h t m l   o r   x m l . 
 
         s e l e c t o r :   " " , 
 
 
 
         / /   F e t c h   A P I   
 
         m e t h o d :   " G E T " , 
 
         h e a d e r s :   { } ,   / /   r e q u e s t   h e a d e r s .   f o r m a t   i s   t h e   i d e n t i c a l   t o   t h a t   a c c e p t e d   b y   t h e   H e a d e r s   c o n s t r u c t o r 
 
         b o d y :   n u l l ,   / /   r e q u e s t   b o d y .   c a n   b e   n u l l ,   a   s t r i n g ,   a   B u f f e r ,   a   B l o b ,   o r   a   N o d e . j s   R e a d a b l e   s t r e a m 
 
         c a c h e :   " d e f a u l t " ,   / /   T h e   c a c h e   m o d e   y o u   w a n t   t o   u s e   f o r   t h e   r e q u e s t :   d e f a u l t ,   n o - s t o r e ,   r e l o a d ,   n o - c a c h e ,   f o r c e - c a c h e ,   o r   o n l y - i f - c a c h e d . 
 
         r e d i r e c t :   " f o l l o w " ,   / /   T h e   r e d i r e c t   m o d e   t o   u s e :   f o l l o w   ( a u t o m a t i c a l l y   f o l l o w   r e d i r e c t s ) ,   e r r o r   ( a b o r t   w i t h   a n   e r r o r   i f   a   r e d i r e c t   o c c u r s ) ,   o r   m a n u a l   ( h a n d l e   r e d i r e c t s   m a n u a l l y ) .   I n   C h r o m e   t h e   d e f a u l t   i s   f o l l o w   ( b e f o r e   C h r o m e   4 7   i t   d e f a u l t e d   t o   m a n u a l ) . 
 
         k e e p a l i v e :   f a l s e ,   / /   T h e   k e e p a l i v e   o p t i o n   c a n   b e   u s e d   t o   a l l o w   t h e   r e q u e s t   t o   o u t l i v e   t h e   p a g e .   F e t c h   w i t h   t h e   k e e p a l i v e   f l a g   i s   a   r e p l a c e m e n t   f o r   t h e   N a v i g a t o r . s e n d B e a c o n ( )   A P I . 
 
           m o d e :   ' c o r s ' ,   / /   T h e   m o d e   y o u   w a n t   t o   u s e   f o r   t h e   r e q u e s t ,   e . g . ,   c o r s ,   n o - c o r s ,   o r   s a m e - o r i g i n . 
 
           c r e d e n t i a l s :   ' o m i t ' ,   / /   T h e   r e q u e s t   c r e d e n t i a l s   y o u   w a n t   t o   u s e   f o r   t h e   r e q u e s t :   o m i t ,   s a m e - o r i g i n ,   o r   i n c l u d e .   T o   a u t o m a t i c a l l y   s e n d   c o o k i e s   f o r   t h e   c u r r e n t   d o m a i n ,   t h i s   o p t i o n   m u s t   b e   p r o v i d e d .   S t a r t i n g   w i t h   C h r o m e   5 0 ,   t h i s   p r o p e r t y   a l s o   t a k e s   a   F e d e r a t e d C r e d e n t i a l   i n s t a n c e   o r   a   P a s s w o r d C r e d e n t i a l   i n s t a n c e . 
 
           r e f e r r e r :   ' c l i e n t ' ,   / /   A   U S V S t r i n g   s p e c i f y i n g   n o - r e f e r r e r ,   c l i e n t ,   o r   a   U R L .   T h e   d e f a u l t   i s   c l i e n t . 
 
           r e f e r r e r P o l i c y :   ' n o - r e f e r r e r ' ,   / /   S p e c i f i e s   t h e   v a l u e   o f   t h e   r e f e r e r   H T T P   h e a d e r .   M a y   b e   o n e   o f   n o - r e f e r r e r ,   n o - r e f e r r e r - w h e n - d o w n g r a d e ,   o r i g i n ,   o r i g i n - w h e n - c r o s s - o r i g i n ,   u n s a f e - u r l . 
 
           s i g n a l :   n u l l ,   / /   A n   A b o r t S i g n a l   o b j e c t   i n s t a n c e ;   a l l o w s   y o u   t o   c o m m u n i c a t e   w i t h   a   f e t c h   r e q u e s t   a n d   a b o r t   i t   i f   d e s i r e d   v i a   a n   A b o r t C o n t r o l l e r . 
 
           i n t e g r i t y :   n u l l   / /   C o n t a i n s   t h e   s u b r e s o u r c e   i n t e g r i t y   v a l u e   o f   t h e   r e q u e s t   ( e . g . ,   s h a 2 5 6 - B p f B w 7 i v V 8 q 2 j L i T 1 3 f x D Y A e 2 t J l l u s R S Z 2 7 3 h 2 n F S E = ) . 
 
     } , 
 
 
 
     s u c c e s s :   f u n c t i o n ( c o n t e n t ,   p r o m i s e ) {         } , 
 
 
 
     e r r o r :   f u n c t i o n ( e r r o r ,   p r o m i s e ) {         } 
 
 
 
 } 
 
 
 
 E x a m p l e : 
 
 
 
 / /   F e t c h   a n   H T M L   p a g e   f r o m   a n   e x t e r n a l   r e s o u r c e   u s i n g   b a s i c   s e t t i n g s . 
 
 $ A . G e t ( { 
 
     u r l :   " / s r c / c o n t e n t . h t m l " , 
 
     s u c c e s s :   f u n c t i o n ( c o n t e n t ,   p r o m i s e ) { 
 
         / /   D o   s o m e t h i n g   w i t h   ' c o n t e n t ' 
 
     } 
 
 } ) ; 
 
 
 
 / /   F e t c h   c o n s e c u t i v e   D O M   e l e m e n t s   f r o m   e x t e r n a l   r e s o u r c e s   t h a t   r e q u i r e   s y n c h r o n o u s   p r o c e s s i n g . 
 
 $ A . G e t ( [ 
 
     / /   F i r s t ,   l o a d   r e s o u r c e 1 
 
     { 
 
         u r l :   " / s r c / c o n t e n t 1 . h t m l " , 
 
         d a t a :   { 
 
             s e l e c t o r :   " # w i d g e t "   / /   G e t   t h e   e l e m e n t   w i t h   i d = " w i d g e t " 
 
         } , 
 
         s u c c e s s :   f u n c t i o n ( c o n t e n t ,   p r o m i s e ) { 
 
             / /   D o   s o m e t h i n g   w i t h   c o n t e n t 
 
         } 
 
     } , 
 
     / /   N e x t ,   l o a d   r e s o u r c e 2 
 
     { 
 
         u r l :   " / s r c / c o n t e n t 2 . h t m l " , 
 
         d a t a :   { 
 
             s e l e c t o r :   " # o p t i o n s "   / /   G e t   t h e   e l e m e n t   w i t h   i d = " o p t i o n s " 
 
         } , 
 
         s u c c e s s :   f u n c t i o n ( c o n t e n t ,   p r o m i s e ) { 
 
             / /   D o   s o m e t h i n g   w i t h   c o n t e n t 
 
         } 
 
     } 
 
     / /   C o n t i n u e . . . 
 
 ] ) ; 
 
 
 
 / /   F e t c h   c o n s e c u t i v e   D O M   e l e m e n t s   f r o m   e x t e r n a l   r e s o u r c e s   u s i n g   a s y n c h r o n o u s   p r o c e s s i n g . 
 
 $ A . G e t ( 
 
     / /   F i r s t ,   l o a d   r e s o u r c e 1 
 
     { 
 
         u r l :   " / s r c / c o n t e n t 1 . h t m l " , 
 
         d a t a :   { 
 
             s e l e c t o r :   " # w i d g e t "   / /   G e t   t h e   e l e m e n t   w i t h   i d = " w i d g e t " 
 
         } , 
 
         s u c c e s s :   f u n c t i o n ( c o n t e n t ,   p r o m i s e ) { 
 
             / /   D o   s o m e t h i n g   w i t h   c o n t e n t 
 
         } 
 
     } 
 
 ) ; 
 
 $ A . G e t ( 
 
     / /   L o a d   r e s o u r c e 2 
 
     { 
 
         u r l :   " / s r c / c o n t e n t 2 . h t m l " , 
 
         d a t a :   { 
 
             s e l e c t o r :   " # o p t i o n s "   / /   G e t   t h e   e l e m e n t   w i t h   i d = " o p t i o n s " 
 
         } , 
 
         s u c c e s s :   f u n c t i o n ( c o n t e n t ,   p r o m i s e ) { 
 
             / /   D o   s o m e t h i n g   w i t h   c o n t e n t 
 
         } 
 
     } 
 
 ) ; 
 
 